package com.tepth.vehiclemaintenance.mvp.work.detail;

import com.tepth.vehiclemaintenance.bean.DetailDriverRemark;
import com.tepth.vehiclemaintenance.bean.MaintainListWork;
import com.tepth.vehiclemaintenance.net.ApiModel;
import com.tepth.vehiclemaintenance.net.Network;

import java.util.ArrayList;

import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;

/**
 * Created by TMVPHelper on 2017/05/15
 */
public class DetailModel implements DetailContract.Model {

    @Override
    public Observable<ApiModel<DetailDriverRemark>> getMaintainDetail(String authKey, int maintainId) {
        return Network.getApiService().getItemDetail(authKey, maintainId)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread());
    }

    @Override
    public Observable<ApiModel<ArrayList<MaintainListWork.ListContentsBean.ListRemarkBean.OperationBean>>> getOperatorList(String authKey) {
        return Network.getApiService().getOperatorList(authKey)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread());
    }
}